﻿using IT_RoadBlock.Controls;
using IT_RoadBlock.ViewModes;
namespace IT_RoadBlock
{
    /// <summary>
    /// MainWindow.xaml 的交互逻辑
    /// </summary>
    public partial class MainWindow : System.Windows.Window
    {

        public MainWindow()
        {
            InitializeComponent();
            //this.Icon = System.Drawing.Icon.FromHandle(IT_RoadBlock.Properties.Resources.logo);
            this.DataContext = new MainWindowViewModel() { SelectedIndexChange = SelectedIndexChange };
            SelectedIndexChange(0);
        }

        private void SelectedIndexChange(int index)
        {
            //projectControl.Visibility = System.Windows.Visibility.Hidden;
            //injectControl.Visibility = System.Windows.Visibility.Hidden;
            if (index ==  0)
            {
                mainContent.Navigate(new ProjectUseControl());
            }
            else if (index ==1)
            {
                mainContent.Navigate(new ProjectInjectionUseControl());
            }
        }
    }
}
